package com.wbt.spring.e02;


import com.wbt.spring.e02.config.UserData;
import com.wbt.spring.e02.service.UserService;
import com.wbt.common.beans.User;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

import java.util.List;

@ComponentScan("com.wbt.spring.e02.**")
public class ContextApplication {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ContextApplication.class);

        UserService userService = context.getBean(UserService.class);

        /**
        User user = new User();
        user.setId("1");
        user.setUserName("小米");
        user.setAge(40);
        user.setWork("EOC架构师");
        */

        userService.addUsers(20000);


        int conut = userService.selectUserCount();
        System.out.println("user conut: " + conut);

       // User user1 = userService.findUserInfo("1");
       // System.out.println("user 1 Info: " + user1.toString());

        //List<User> list = userService.findAllUser();
        //System.out.println("user List: " + list.toString());

    }
}
